﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class MsgMng_EmailBox : System.Web.UI.Page
{
	protected void Page_Load(object sender, EventArgs e)
	{
		using (var mmb = new PBOffice.BLL.MsgMngBLL())
		{
			int readCount = 0, sum = 0;
			var user = (PBOffice.DAL.User)Session["userManage"];
			foreach (var msg in mmb.GetReceivedMessages(user))
			{
				if (mmb.IsMessageRead(user.UserNo, msg.MessNo))
					readCount++; sum++;
			}
			lbAllCount.Text = sum.ToString();
			lbNotReadedCount.Text = (sum - readCount).ToString();
			lbSentCount.Text = mmb.GetSentMessages(user).Count.ToString();
		}
	}
}